package com.yunyang.jczd.facade;

import feign.Retryer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

/**
 * @author : liuzuowei
 * @time : 2019-10-13 22:44
 */
@EnableAsync
@SpringBootApplication
@MapperScan(value = "com.yunyang.jczd.facade.*.mapper")
@EnableDiscoveryClient
@ComponentScan("com.yunyang.jczd")
public class FacadeApplication {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(FacadeApplication.class);
        springApplication.run(args);
    }

    /**
     * 可以通过rabbin 使用集群的内部优势
     * @return
     */
    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }



}
